package com.todo.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * AI配置类
 */
@Data
@Component
@ConfigurationProperties(prefix = "ai")
public class AiConfig {

    /**
     * 默认AI服务提供商
     */
    private String defaultProvider = "openai";

    /**
     * 代理配置
     */
    private ProxyConfig proxy = new ProxyConfig();

    /**
     * OpenAI配置
     */
    private ProviderConfig openai = new ProviderConfig();

    /**
     * Gemini配置
     */
    private ProviderConfig gemini = new ProviderConfig();

    /**
     * 通义千问配置
     */
    private ProviderConfig qwen = new ProviderConfig();

    @Data
    public static class ProxyConfig {
        /**
         * 是否启用代理
         */
        private boolean enabled = false;

        /**
         * 代理主机
         */
        private String host = "127.0.0.1";

        /**
         * 代理端口
         */
        private int port = 7890;
    }

    @Data
    public static class ProviderConfig {
        /**
         * API密钥
         */
        private String apiKey;

        /**
         * 基础URL
         */
        private String baseUrl;

        /**
         * 模型名称
         */
        private String model;

        /**
         * 最大tokens
         */
        private int maxTokens = 1000;
    }
} 